home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / DevCon / Milan_1991 / Devcon91.4 / Installer / Installer.doc < prev    next >
Encoding:
Text File  |  1992-09-01  |  45.0 KB  |  1,341 lines

  1.             Installer Documentation
  2.             Last Revised: October 18, 1991
  3.  
  4.  
  5. Contents:
  6.  
  7.     BACKGROUND
  8.  
  9.     OVERVIEW
  10.         Standard Invocation
  11.         Initial Actions
  12.         Startup Screens
  13.         Installation Actions
  14.  
  15.     SCRIPTING LANGUAGE TUTORIAL
  16.         Basic elements
  17.         Escape characters
  18.         Symbols
  19.         Types of symbols
  20.         Statements
  21.         Data types
  22.         Special Features
  23.         Miscellaneous
  24.  
  25.     INSTALLER LANGUAGE REFERENCE
  26.         Notes
  27.         Statements
  28.         Control Statements
  29.         Functions
  30.         Summary of parameters
  31.         Pre-defined variables
  32.  
  33.     INSTALLER LANGUAGE QUICK REFERENCE
  34.         Overview
  35.         Quick Language Overview
  36.         Pre-defined variables
  37.         Default Help String Variables
  38.         Statements
  39.         Functions
  40.  
  41.                 BACKGROUND
  42.  
  43. Installation of applications from floppy disks onto a hard disk has
  44. proven to be a very inconsistent and often frustrating endeavor for
  45. most end-users.  This has been caused by many factors, some of which
  46. are:
  47.  
  48. 1. Many products do not come with any utility or script to install an
  49. application on a hard disk.
  50.  
  51. 2. Many products assume a great deal of familiarity with the startup
  52. process of the Amiga and applications, including assigns, device names
  53. (as opposed to volume names), etc.
  54.  
  55. 3. The installation scripts or utilities included with some products
  56. vary widely in their ability to deal with different environments and
  57. systems.
  58.  
  59. About a year ago, Commodore set out to remedy this situation, by
  60. developing a standard tool that developers can include with their
  61. products, which provides the user with a standard way to install
  62. applications.  The Installer's features were based on a number of
  63. assumptions:
  64.  
  65. 1. Installation requirements vary widely---some need assigns, some need
  66. new drawers created, some install pieces in system drawers such as a
  67. fonts drawer, a `product' might be just an upgrade and the installation
  68. must check to see which version (if any) they currently have installed,
  69. etc.
  70.  
  71. 2. Different users have different levels of comfort and expertise when
  72. attempting to install software, and the Installer should be able to
  73. accomodate a range of users.  Many installation scripts assume a great
  74. deal of knowledge, which is very intimidating for a novice.
  75.  
  76. 3. The installer tool must be very flexible internally, but present a
  77. consistent pleasant graphical user interface to the user that only
  78. shows the user information or prompts that they need to see.  The
  79. Installer should be resolution, color and font sensitive.
  80.  
  81. 4. Writing scripts to install an application will require some effort,
  82. but certainly no more than writing an AmigaDOS shell script equivalent,
  83. and the resulting installation procedure will be more friendly,
  84. flexible, and much better looking than the latter.
  85.  
  86. 5. Not everyone will be running 2.0 by the time the tool becomes
  87. available, so it must run under 1.3 and 2.0.
  88.  
  89.  
  90.                 OVERVIEW
  91.  
  92. The Installer is a script driven program, that presents a consistent
  93. installation environment to the end user.  The user never sees the
  94. script.  Instead they are presented with simple yes/no choices, and may
  95. be asked to specify locations to put things on their system.
  96.  
  97. To accomodate different user levels, they can choose to run the tool in
  98. novice, average or expert modes.  Scripts can include help text to
  99. explain any choices that the user must make.  At each step the user is
  100. given the option of aborting the installation.
  101.  
  102.  
  103. Standard Invocation
  104.  
  105. The Installer is normally started up from a Workbench Project icon
  106. which has the same name as the script to interpret and has a default
  107. tool of Installer.  A number of tooltypes are available to modify the
  108. operation of the Installer:
  109.  
  110.     APPNAME - Name of the application being installed (appears in
  111.         the startup screen). This MUST be given.
  112.  
  113.     MINUSER - The minimum possible operation mode of the
  114.         installation for a script. This will be either NOVICE
  115.         (all decisions made by Installer), AVERAGE (only
  116.         important decisions made by user) or EXPERT (user gets
  117.         to confirm almost all actions). The default is NOVICE.
  118.  
  119.     DEFUSER - Indicates which operation mode button should be
  120.         initially selected. Same values as MINUSER, with the
  121.         value of the MINUSER tooltype being the default (which
  122.         will be NOVICE if MINUSER not defined).
  123.  
  124.     PRETEND - If set to FALSE, indicates that PRETEND mode not
  125.         available for this script.
  126.  
  127.     LOGFILE - The name of the log file that the Installer should
  128.         use.  This must be a full path.  The default is
  129.         "install_log_file".
  130.  
  131.     LOG - In NOVICE mode the default is to create a log file (to disk).
  132.         If this tooltype is set to FALSE, the creation of a log file in
  133.         NOVICE mode is disabled.
  134.  
  135. Although the installer can be started up from the CLI, that is not the
  136. recommended mode.  CLI invocation is provided mainly for script debugging
  137. purposes.  The command template is:
  138.  
  139.     SCRIPT/k,APPNAME,MINUSER,DEFUSER,LOGFILE,NOLOG/s,NOPRETEND/s
  140.  
  141.  
  142. Initial Actions
  143.  
  144. The first thing the installer does is compile the installation script
  145. into an internal format that can be easily interpreted. If there are
  146. syntax errors in the script, they will be caught during this phase.
  147.  
  148.  
  149. Startup Screens
  150.  
  151. Next, the Installer asks the user what Installation Mode to run in,
  152. either NOVICE, AVERAGE or EXPERT.  If the user chooses NOVICE, they
  153. will not be asked any more questions (although they may be requested to
  154. do things).  In the other user levels, a second display appears asking
  155. the user if he wants to install "for real" or "do a dry run", and if he
  156. wants a transcription of the installation process written to either a
  157. file or printer.
  158.  
  159.  
  160. Installation Actions
  161.  
  162. Now the Installer interprets its internal version of the script. Any
  163. commands that call for a user interface will cause the Installer to
  164. algorithmically generate a display, always including buttons to allow
  165. for context sensitive help and aborting the installation.
  166.  
  167.  
  168.             SCRIPTING LANGUAGE TUTORIAL
  169.  
  170. The script langauge of the Installer is based on LISP.  It is not
  171. difficult to learn, but requires a lot of parentheses.  An Installer
  172. script can easily be made to look very readable.
  173.  
  174. Basic elements: The basic elements of the installer language are:
  175.  
  176.     Type                    Example
  177.     ----                    -------
  178.     decimal integers            5
  179.     hexadecimal integers            $a000
  180.     binary integers                %0010010
  181.     strings                    "Hello" or 'Hello'
  182.     symbols                    x
  183.     comments                ; this is a comment
  184.     ( )                    for statement definition
  185.     space (or any white space)        delimits symbols
  186.  
  187. Escape-characters are supported as in the C language:
  188.  
  189.     Escape sequence                Produces
  190.     ---------------                --------
  191.     '\n'                    newline character
  192.     '\r'                    return character
  193.     '\t'                    tab character
  194.     '\0'                    a NUL character
  195.     '\"'                    a double-quote
  196.     '\\'                    a backslash
  197.  
  198. Symbols (variables): a symbol is any sequence of characters surrounded
  199. by spaces that is not a quoted string, an integer or a control
  200. character. This means that symbols can have punctuation marks and other
  201. special characters in them. The following are all valid symbols:
  202.  
  203.     x
  204.     total
  205.     this-is-a-symbol
  206.     **name**
  207.     @#__#@
  208.  
  209. Types of symbols: There are three types of symbols:
  210.  
  211.     - user-defined symbols. These are created using the "set"
  212.       function.
  213.     - built-in function names. These include things like '+' and
  214.       '*' as well as textual names such as "delete" or "rename".
  215.     - special symbols. These are variables which are created by the
  216.       installer before the script actually starts to run, and are
  217.       used to tell the script certain things about the environment.
  218.       These symbols always begin with an '@' sign. An example is
  219.       '@default-dest' which tells you the default directory that was
  220.       selected by the installer.
  221.  
  222. Statements: The format of a statement is:
  223.  
  224.     (operator <operand1> <operand2> ...)
  225.  
  226. A statement to assign the value '5' to the variable 'x' would be:
  227.  
  228.     (set x 5)
  229.  
  230. You can read this as "set x to 5". Note that the variable 'x' does not
  231. have to be declared -- it is created by this statement.
  232.  
  233. Note that there is no difference between operators and functions -- the
  234. function 'set' and the arithmetic operator '+' are both used exactly
  235. the same way.
  236.  
  237. Combining statements: A statement can be used as the operand to another
  238. statement as follows:
  239.  
  240.     (set var (+ 3 5))
  241.  
  242. In this case, the statement '(+ 3 5)' is evaluated first, and the
  243. result is 8. You can think of this as having the '(+ 3 5)' part being
  244. replaced by an 8. So now we are left with:
  245.  
  246.     (set var 8)
  247.  
  248.     -- which is the same form as the first example.
  249.  
  250. Note that the '(+ 3 5)' part actually produced a value: "8". This is
  251. called the "result" of the statement. Many statements return results,
  252. even some that might surprise you (such as "set" and "if").
  253.  
  254. Data Types: All data types in the installer are dynamic, that is to say
  255. the type of a variable is determined by the data that is in it. So if
  256. you assign the string "Hello, World" to the variable 'x', then 'x' will
  257. be of type STRING. Later you can assign an integer to 'x' and x will be
  258. of type INTEGER.  When using variables in expressions, the interpreter
  259. will attempt to convert to the proper type if possible.
  260.  
  261. Special forms: There are two exceptions to the form of a statement. The
  262. first type is used for string substitution: If the first item in
  263. parentheses is a text string rather than a function name, the result of
  264. that clause is another string that is created by taking the original
  265. string and performing a "printf"-like formatting operation on it, using
  266. the other arguments of the statement as parameters to the formatting
  267. operation.
  268.  
  269. Thus the statement:
  270.  
  271.     ("My name is %s and I am %ld years old" "Mary" 5)
  272.  
  273. Becomes:
  274.  
  275.     "My name is Mary and I am 5 years old"
  276.  
  277. Note since the formatting operation uses the ROM "RawDoFmt" routine,
  278. you must always say "%ld" rather than "%d" (The interpreter always
  279. passes numeric quantities as longwords).
  280.  
  281. The second type of exception occurs if the elements in parentheses are
  282. themselves statements in parentheses. In this case, the interpreter
  283. assumes that all the elements are statements to be executed
  284. sequentially.
  285.  
  286. For example, this statement sets the value of three different
  287. variables, "var1", "var2" and "var3":
  288.  
  289.     ((set var1 5) (set var2 6) (set var3 7))
  290.  
  291. What this feature does is allow the language to have a block structure,
  292. where an "if" statement can have multiple statements in it's "then" or
  293. "else" clause. Note that the result of this statement will be the
  294. result of the last statement in the sequence.
  295.  
  296. Complex statements: Here is an example of how statements in the script
  297. language can be combined into complex expressions. We will start with
  298. an "if" statement. The basic format of an "if" statement is:
  299.  
  300.     (if <condition> <then-statement> [<else-statement>])
  301.  
  302. The condition should be a statement which returns a value. Then "then"
  303. and optional "else" parts should be statements. Note that if the "then"
  304. or "else" statements produce a result, then the "if" statement will
  305. also have this result.
  306.  
  307. Our first example is a rather strange one: Using an "if" statement to
  308. simulate a boolean "not" operator. (Note that there are easier ways in
  309. the script language to do this).
  310.  
  311.     (set flag 0)                ; set a flag to FALSE
  312.  
  313.     (set flag (if flag 0 1))        ; a Boolean NOT
  314.  
  315. Basically, the "if" statement tests the variable "flag". If flag is
  316. non-zero, it produces the value "0". Otherwise, the result is "1". In
  317. either case, "flag" is set to the result of the "if" statement.
  318.  
  319. Now, let's plug some real statements into our "if" statement.
  320.  
  321.     (if flag                    ; conditional test
  322.         (message "'flag' was non-zero\n")    ; "then" clause.
  323.         (message "'flag' was zero\n")        ; "else" clause.
  324.     )                        ; closing parenthesis
  325.  
  326. Note the style of the indenting. This makes for an easier to read program.
  327.  
  328. Now, we'll add a real condition. The "=" operator tests for equality of
  329. two items.
  330.  
  331.     (if (= a 2)                    ; conditional test
  332.         (message "a is 2\n")            ; "then" clause
  333.         (message "a is not 2\n")        ; "else" clause
  334.     )                        ; closing parenthesis
  335.  
  336. Finally, just to make things interesting, we'll make the "else" clause
  337. a compound statement.
  338.  
  339.     (if (= a 2)                    ; conditional test
  340.         (message "a is 2\n")            ; "then" clause
  341.         (    (message "a is not 2\n")    ; "else" compound stmt
  342.             (set a 2)
  343.             (message "but it is now!\n")
  344.         )                    ; end of compound statement
  345.     )                        ; end of if
  346.  
  347.  
  348. Special Features
  349.  
  350. When the Installer first starts up, it attempts to determine the "best"
  351. place to install the application. Any volume named "WORK:" is given
  352. preference, as this is the standard way that an Amiga comes configured
  353. from Commodore.
  354.  
  355. There are two keyboard shortcuts. Whenever there is a "Help" button
  356. active, pressing the HELP key will also bring up the help display.
  357. Whenever there is an "Abort" button active, pressing ESC brings up the
  358. abort requester. Also, whenever the installer is "busy", pressing ESC
  359. brings up the abort requester -- there is text is the title bar to that
  360. effect.
  361.  
  362. If an application must have assigns or other actions performed
  363. during system boot, the Installer will add these to a file named
  364. "S:user-startup". The installer will then add the lines
  365.  
  366.     if exists S:user-startup
  367.     execute S:user-startup
  368.     endif
  369.  
  370. to the user's "startup-sequence". The Installer will attempt to
  371. determine the boot volume of the system when looking for the
  372. "startup-sequence" and can handle any AmigaDOS scripts executed from
  373. "startup-sequence" (up to 10 levels of nesting).
  374.  
  375. The Installer can create an assign to just a device, volume or logical
  376. assignment. This comes in handy when you want to update an application
  377. which comes on a volume named "MyApp:", but the installed version is in
  378. a directory with the logical assign "MyApp:"!
  379.  
  380. The Installer always copies files in CLONE mode, meaning all the
  381. protection bits, filenotes and file dates are preserved. When copying
  382. files the Installer gives a "fuelgauge" readout of the progress of the
  383. copy.
  384.  
  385. The Installer can find the version number of any executable file that
  386. has either a RomTag with an ID string (such as libraries and devices)
  387. or has a version string conforming to that given in the 1990 DevCon
  388. notes. The Installer can also checksum files. A seperate utility named
  389. "instsum" is provided to determine a file's checksum for use with this
  390. feature.
  391.  
  392.  
  393. Miscellaneous
  394.  
  395. To perform a set of actions on all the contents of a directory matching
  396. a pattern you can use the "foreach" operator. To perform a set of
  397. actions on an explicit set of files, the following installer statements
  398. can be used as a template:
  399.  
  400.     (set n 0)
  401.     (while (set thisfile (select n "file1" "file2" "file3" ""))
  402.         (    (set n (+ n 1))
  403.             (... your stuff involving thisfile ...)
  404.         )
  405.     )
  406.  
  407. Note that an empty string is considered a FALSE value to any condition
  408. operator.
  409.  
  410. To run an external CLI command which normally requires user input,
  411. redirect the input from a file with the needed responces. For example,
  412. to format a disk one could combine the statement shown below with a
  413. file which contains only a newline character.
  414.  
  415.     (run "format <nl_file drive DF0: name ToBeEmpty")
  416.  
  417.  
  418.             INSTALLER LANGUAGE REFERENCE
  419.  
  420. NOTES
  421.  
  422. 1. When the script exits either by comming to the end or via the "exit"
  423. statement, a message will be displayed saying where the application was
  424. installed and where the logfile (if any) was written. Note that you
  425. must store in "@default-dest" where you actually installed the
  426. application (see "@default-dest" below).
  427.  
  428. 2. A newline character ('\n', 0x0a) will cause a line break when the
  429. installer performs word-wrapping.. A hard-space (ALT-space, 0xa0) will
  430. prevent a word break when the installer performs word-wrapping. Also,
  431. quoted sections will be considered one word for word-wrapping purposes.
  432. For example, if the following help text was used:
  433.  
  434.     "The disk name \"FrameZapper 2.0\" is needed to complete installation."
  435.  
  436. Then the text "FrameZapper 2.0" will not have a word break before the "2".
  437.  
  438. 3. The maximum size of a string in a script is 512 bytes.
  439. The maximum size of any string variable is 10000 bytes. If you need to
  440. create long help text for example, break it into 512 byte chunks and
  441. then use the automatic string concatination ability of the installer to
  442. create the final, larger string.  Also, don't overlook the the use of
  443. line continuation of strings in scripts to make your scripts more
  444. managable. If you ever find that the installer reports a stack overflow
  445. error, look to see if it caused by too many small strings being
  446. concatinated and merge them into larger blocks.
  447.  
  448. 4. The "run" and "execute" statements only return the result of the command
  449. run or executed under 2.0; they always return 0 under 1.3. If you must have
  450. some result under both 1.3 and 2.0, try this combo:
  451.  
  452.     # in the DOS script to execute:
  453.     failat 31
  454.     command
  455.     if error
  456.         setenv installer-result 10
  457.     else
  458.         if warn
  459.             setenv installer-result 5
  460.         else
  461.             setenv installer-result 0
  462.         endif
  463.     endif
  464.  
  465.     # in the installer script
  466.     (execute DOS-Script)
  467.     (set theResult (getenv "installer-result"))
  468.  
  469. STATEMENTS
  470.  
  471. (set <varname> <value> [<varname2> <value2> ...])
  472.  
  473. Set the variable <varname> to the indicated value. If <varname> does
  474. not exist it will be created. Set returns the value of the last
  475. assignment.
  476.  
  477. Note: All variables are typeless, and any variable may be used wherever
  478. a string could be used. All variables are global.
  479.  
  480. (makedir <name> <parameters>)
  481.  
  482. Creates a new directory.  Parameters:
  483.  
  484.     prompt - tell the user what's going to happen.
  485.     help - text of help message
  486.     infos - create an icon for directory
  487.     confirm - if this option is present, user will be prompted,
  488.         else the directory will be created silently.
  489.     safe - make directory even if in PRETEND mode
  490.  
  491. (copyfiles <parameters>)
  492.  
  493. Copies one or more files from the install disk to a target directory.
  494. Each file will be displayed with a checkmark next to the name
  495. indicating if the file should be copied or not.  Parameters:
  496.  
  497.     prompt, help - as above
  498.     source - name of source directory or file
  499.     dest - name of destination directory, which is created if it
  500.         doesn't exist
  501.     newname - if copying one file only, and file is to be renamed, this is
  502.         the new name
  503.     choices - a list of files/directories to be copied (optional)
  504.     all - all files/directories in the source directory should be copied
  505.     pattern - indicates that files/directories from the source dir
  506.         matching a pattern should be copied
  507.     files - only copy files. By default the installer will match and copy
  508.         subdirectories.
  509.     infos - switch to copy icons along with other files/directories
  510.     fonts - switch to not display ".font" files, yet still copy any that
  511.         match a directory that is being copied.
  512.     optional - makes it not a fatal error if a file doesn't copy
  513.     confirm -  if this option is present, user will be prompted to
  514.         indicate which files are to be copied, else the files
  515.         will be copied silently.
  516.     safe - copy files even if in PRETEND mode.
  517.  
  518. (copylib <parameters>)
  519.  
  520. Copies one file using version checking; i.e., it only overwrites an
  521. existing file if the new file has a higher version/revision number.
  522. Parameters:
  523.  
  524.     prompt, help - as above
  525.     source - name of source directory or file
  526.     dest - name of destination directory
  527.     newname - if copying one file only, and file is to be renamed,
  528.         this is the new name
  529.     infos - switch to copy icons along with other files
  530.     optional - makes it not a fatal error if a file doesn't copy
  531.     confirm - user will be asked to confirm. Note that an EXPERT user
  532.         will be able to overwrite a newer file with an older one.
  533.     safe - copy the file even if in PRETEND mode
  534.  
  535. (startup <appname> <parameters>)
  536.  
  537. This command edits the "S:user-startup" file, which is executed by the
  538. user's startup-sequence (Installer will modify the user's
  539. startup-sequence if needed, although in a friendly way). The "command"
  540. parameter is used to declare AmigaDOS command lines which will be
  541. executed. The command lines are grouped by application, using the
  542. supplied argument "appname". If there is already an entry in
  543. "S:user-startup" for that application, the new command lines will
  544. completely replace the old. The command lines for other applications
  545. will not be affected.  Parameters:
  546.  
  547.     prompt, help - as above
  548.     command - used to declare an AmigaDOS command line to be
  549.         executed at system startup.
  550.  
  551. (tooltype <parameters>)
  552.  
  553. Modify an icon's tool type. Normally the new tool type values will be
  554. set up in advance by various statements in the install language (i.e.
  555. the user does not actually have to type in the tooltype values). For
  556. example, you could use an "askchoice" to ask the user what type of
  557. screen resolution they want and then format the tooltype string based
  558. on their choice. The "tooltype" operation merely asks for a
  559. confirmation before actually writing.  Parameters:
  560.  
  561.     prompt, help - as above
  562.     dest - the icon to be modified
  563.     settooltype - the tooltype name and value string.
  564.     setdefaulttool - default tool for a project
  565.     setstack - set size of stack
  566.     noposition - reset to NOICONPOSITION
  567.     confirm - if this option is present, the user will be asked for
  568.         confirmation, otherwise the modification proceeds
  569.         silently.
  570.     safe - make changes even if in PRETEND mode
  571.  
  572. (textfile <parameters>)
  573.  
  574. Creates a text file from other textfiles or computed text strings. This
  575. can be used to create configuration files, AREXX programs or execute
  576. scripts.  Parameters:
  577.  
  578.     help, prompt - as above
  579.     dest - the name of the text file to be created.
  580.     append - a string to be appended to the new text file.
  581.     include - a text file to be appended to the new text file.
  582.     confirm - if this option is present, the user will be asked for
  583.     confirmation, otherwise the writing proceeds silently.
  584.     safe - create file even if in PRETEND mode
  585.  
  586. (execute <argument> ...)
  587.  
  588. Executes an AmigaDOS script with the arguments given. NOTE: Does not
  589. ask user for confirmation, however this can be added by using
  590. "askchoice" or "askbool".  Parameters:
  591.  
  592.     help, prompt - as above
  593.     confirm - if this option is present, the user will be asked for
  594.         confirmation, otherwise the execute proceeds silently.
  595.     safe - execute script even if in PRETEND mode
  596.  
  597. Returns a result is executed under 2.0.  Returns 0 under 1.3.  See
  598. NOTES for workarounds under 1.3.
  599.  
  600. (run <argument> ...)
  601.  
  602. Executes a compiled program with the arguments given. NOTE: Does not
  603. ask user for confirmation, however this can be added by using
  604. "askchoice" or "askbool".  Parameters:
  605.  
  606.     help, prompt - as above
  607.     confirm - if this option is present, the user will be asked for
  608.         confirmation, otherwise the run proceeds silently.
  609.     safe - run program even if in PRETEND mode
  610.  
  611. Returns a result is executed under 2.0.  Returns 0 under 1.3.  See
  612. NOTES for workarounds under 1.3.
  613.  
  614. (rexx <argument> ...)
  615.  
  616. Executes n ARexx script with the arguments given. NOTE: Does not ask
  617. user for confirmation, however this can be added by using "askchoice"
  618. or "askbool". If the ARexx server is not active, an error will be
  619. generated.  Parameters:
  620.  
  621.     help, prompt - as above
  622.     confirm - if this option is present, the user will be asked for
  623.     confirmation, otherwise the rexx script proceeds silently.
  624.     safe - execute script even if in PRETEND mode
  625.  
  626. (makeassign <assign> [<path>] (parameters))
  627.  
  628. Assigns 'assign' to 'path'. If 'path' is not specified, the assignment
  629. is cleared.  Parameters:
  630.  
  631.     safe - execute script even if in PRETEND mode
  632.  
  633. Note: assign must be supplied without a colon; i.e. "ENV" not "ENV:".
  634.  
  635. (rename <oldname> <newname> <parameters>)
  636.  
  637. Renames a file or directory. If the "disk" parameter is given, then
  638. this command relabels the disk named oldname to newname. When
  639. relabeling a disk, ONLY include a colon in the oldname. Returns 1 if
  640. the rename was successful, 0 if it failed.  Parameters:
  641.  
  642.     help, prompt - as above
  643.     confirm - if this option is present, the user will be asked for
  644.         confirmation, otherwise the rename proceeds silently.
  645.     disk - switch to get rename to relabel a disk.
  646.     safe - rename even if in PRETEND mode
  647.  
  648. (delete <file> <parameters>)
  649.  
  650. Delete a file. Parameters:
  651.  
  652.     help, prompt - as above
  653.     confirm - if this option is present, the user will be asked for
  654.         confirmation, otherwise the delete proceeds silently.
  655.     safe - delete even if in PRETEND mode
  656.  
  657. (protect <file> [<protection-bits>] <parameters>)
  658.  
  659. Either gets the protection bits for a file (if second argument not
  660. given), or sets them. When setting bits, returns 1 if the attempt
  661. succeeded, else returns a 0. Getting the bits returns a -1 if it
  662. failed.  Parameters:
  663.  
  664.     safe - change protection even if in PRETEND mode
  665.  
  666. (abort <message> <message> ...)
  667.  
  668. Exits the installation procedure with the given messages and then
  669. processes the onerror statements (is any).
  670.  
  671. (exit)
  672.  
  673. This causes normal termination of a script. The "done with
  674. installation" message is displayed. The "onerror" statements are not
  675. executed.
  676.  
  677. (complete <number>)
  678.  
  679. This statement is used to inform the user how complete the installation
  680. is. The number (which must be between 0 and 100) will be printed in the
  681. title bar of the installer window with a '%' sign.
  682.  
  683. (message <string> <string> ...)
  684.  
  685. This statement displays a message to the user in a window, along with
  686. Proceed, Abort and optional Help buttons.  Parameters:
  687.  
  688.     help - optional help text
  689.  
  690. (working <string> <string> ...)
  691.  
  692. The strings will be concatenated to form a message which will appear
  693. below a standard line that reads "Working on Installation".
  694. Useful if you are a doing a long operation other than file copying
  695. (which has its own status display).
  696.  
  697. (user <user-level>)
  698.  
  699. Used to change the user level of the current installation. This
  700. statement should ONLY be used when debugging scripts.  Remove such
  701. statements from any script before distribution of your product.
  702. Returns the current user level.
  703.  
  704.  
  705. CONTROL STATEMENTS
  706.  
  707. NOTE: Strings can be used as the result of a test expression. An empty string
  708. is considered a FALSE value, all others are considered TRUE.
  709.  
  710. (if <expression> <true-statement> <false-statement>)
  711.  
  712. Operates as a standard "if-then" statement.
  713.  
  714. (while <expression> <statement> ... )
  715.  
  716. Operates as a standard "do-while" statement.
  717.  
  718. (until <expression> <statement> ... )
  719.  
  720. Operates as a standard "do-until" statement.
  721.  
  722. (foreach <drawer name> <pattern> <statement>)
  723.  
  724. For each file or directory matching the pattern located in the given
  725. drawer statement will be executed. The special variables "@each-name"
  726. and "@each-type" will contain the filename and the DOS object type,
  727. respectfully. (By DOS object type we mean the same value as found in
  728. fib_DirEntryType if one Examine'd the object.)
  729.  
  730. ((...) (...) (...))
  731.  
  732. Execute a sequence of statements. The statements in the parentheses will be
  733. executed in order -- not needed at topmost level.
  734.  
  735. (trap <trapflags> <statements>)
  736.  
  737. Used for catching errors. Works much like C "longjmp", i.e. when an
  738. error occurs, control is passed to the statement after "trap".
  739. "Trapflags" determine which errors are trapped. The trap statement
  740. itself returns the error type or zero if no error occured. The current
  741. error type values are:
  742.  
  743.     1 - user aborted
  744.     2 - ran out of memory
  745.     3 - error in script
  746.     4 - DOS error (see @ioerr below)
  747.     5 - bad parameter data
  748.  
  749. (onerror <statements>)
  750.  
  751. When a fatal error occurs that was not trapped, a set of statements can
  752. be called to clean-up after the script. These statements are logged in
  753. by using the onerror construct. Note that onerror can be used multiple
  754. times to allows context sensitive termination.
  755.  
  756.  
  757. FUNCTIONS
  758.  
  759. (<string> <arguments> ...)
  760.  
  761. The "string substitution function". Whenever a text string is the first
  762. item in a parenthesized group, the arguments will be substituted into
  763. the string using RawDoFmt. Note: This function does no argument type
  764. checking.
  765.  
  766. (cat <string> <string> ...)
  767.  
  768. Concatenates the strings and returns the resulting string.
  769.  
  770. (transcript <string> <string> ...)
  771.  
  772. Concatenates the strings, appends a newline and then prints the
  773. resulting string to the transcript file (if any).
  774.  
  775. (tackon <path> <file>)
  776.  
  777. Concatenates the filename to the pathname and returns resulting string.
  778.  
  779. (fileonly <path>)
  780.  
  781. Returns only the file part of a pathname.
  782.  
  783. (pathonly <path>)
  784.  
  785. returns only the non-file part of a pathname.
  786.  
  787. (askdir <parameters>)
  788.  
  789. Asks the user for a directory name, with a scrolling list requester.
  790. The user can either create a new directory or specify an existing one.
  791. If the user cancels, the routine will cause an abort. Parameters:
  792.  
  793.     prompt, help - as above
  794.     default - default name of directory to be selected.
  795.  
  796. (askfile <parameters>)
  797.  
  798. Asks the user for a file name, with a scrolling list requester.
  799. Parameters:
  800.  
  801.     prompt, help - as above
  802.     default - default name of file to be selected
  803.  
  804. (askstring <parameters>)
  805.  
  806. Prompts the user to enter a text string.  Parameters:
  807.  
  808.     prompt, help - as above
  809.     default - the default text string.
  810.  
  811. (asknumber <parameters>)
  812.  
  813. Prompts the user to enter an integer quantity.  Parameters:
  814. Prints the allowed range below the integer gadget if the "range"
  815. parameter is given, and prevents the user from proceeding without
  816. entering a valid number.
  817.  
  818.     prompt, help - as above
  819.     range - valid input range of numbers
  820.     default - default value
  821.  
  822. (askchoice <parameters>)
  823.  
  824. Ask the user to select one out of N choices, using radio buttons.
  825. Parameters:
  826.  
  827.     prompt, help - as above
  828.     choices - a list of choice strings, such as "ok" "cancel", etc.
  829.     default - the number of the default choice (defaults to 0)
  830.  
  831. (askoptions <parameters>)
  832.  
  833. Ask the user to select any number of N choices, using checkbox buttons.
  834. A bit mask is returned as a result, with the first bit indicating the
  835. state of the first choice, etc.  Parameters:
  836.  
  837.     prompt, help - as above
  838.     choices - a list of choice strings, such as "ok" "cancel", etc.
  839.     default - a bit mask of the buttons to be checked (defaults to -1)
  840.  
  841. (askbool <parameters>)
  842.  
  843. Ask the user to select yes or no.  Parameters:
  844.  
  845.     prompt, help - as above
  846.     default - 0 = no, 1 = yes
  847.         choices - change the positive and negative text. The defaults are
  848.         "Yes" and "No". So to change the text to "Proceed" and "Cancel"
  849.         you would use: (choices "Proceed" "Cancel")
  850.  
  851. (askdisk <parameters>)
  852.  
  853. Ask the user to insert a disk in a user friendly manner. For instance,
  854. the prompt can describe the disk by its label; e.g. "FooBar Program Disk".
  855. This function will not exit until the correct disk is inserted, or the user
  856. aborts.
  857.  
  858.     prompt, help - as above
  859.         dest - the volume name of the disk to be inserted
  860.     newname - a name to assign to the disk for future reference.
  861.         This assignment is done even in Dry Run mode -- it is
  862.         considered "safe" disk - switch to get a drive list to
  863.         be shown initially.
  864.     Note: volume name must be supplied without a colon; i.e. "ENV" not "ENV:".
  865.  
  866. (exists <filename>)
  867.  
  868. Returns 0 if does not exists, 1 if a file, and 2 if a directory.
  869.  
  870. (earlier <file-1> <file-2>)
  871.  
  872. Returns TRUE is file-1 is earlier than file-2.
  873.  
  874. (getsize <filename>)
  875.  
  876. Returns the size of a file.
  877.  
  878. (getdiskspace <pathname>)
  879.  
  880. Returns the available space in bytes on the disk given by pathname.
  881. Returns a -1 if the pathname is bad or information could not be
  882. obtained from the filesystem (even though pathname was valid).
  883.  
  884. (getsum <filename>)
  885.  
  886. Returns the checksum of a file, for comparing versions.
  887.  
  888. (getversion <filename>)
  889.  
  890. If the named file has a RomTag with an ID string or a 2.x version
  891. string, this will return the version number. If filename is not
  892. provided, then the version of the OS is returned instead. Note that
  893. this function does NOT assume files ending with ".library" or ".device"
  894. reside a particular place -- the path must be included.
  895.  
  896. The version number is returned as a 32 bit value, where the high order
  897. 16 bit word is the version and the low order word is the revision.
  898. Here is some sample statements to parse a version number:
  899.  
  900. (set vernum (getversion "c:iconx"))
  901. (set ver (/ vernum 65536))
  902. (set rev (- vernum (* ver 65536) ) )
  903.  
  904. (message
  905.         ("You have version %ld.%ld" ver rev)
  906. )
  907.  
  908. (getenv <name>)
  909.  
  910. Returns the contents of the given ENV: variable.
  911.  
  912. (getassign <name> <opts>)
  913.  
  914. Returns the pathname of the object 'name'. The default is for logical
  915. assignments only, but can be changed using an options string where the
  916. characters are:
  917.  
  918.     'v' - only match volumes
  919.     'a' - only match logical assignments
  920.     'd' - only match devices
  921.  
  922. Therefore 'a' would be equalivant to having no options.
  923.  
  924. Note: name must be supplied without a colon; i.e. "ENV" not "ENV:".
  925.  
  926. (select <n> <item> <item> ...)
  927.  
  928. Returns the value of the Nth item.
  929.  
  930. (=  <expression-1> <expression-2>)
  931. (>  <expression-1> <expression-2>)
  932. (>= <expression-1> <expression-2>)
  933. (<  <expression-1> <expression-2>)
  934. (<= <expression-1> <expression-2>)
  935. (<> <expression-1> <expression-2>)
  936.  
  937. These are the standard relational expressions.
  938.  
  939. (+  <expression> ...)
  940.  
  941. Returns the sum of all the arguments.
  942.  
  943. (-  <expression-1> <expression-2>)
  944.  
  945. Returns the first argument minus the second argument
  946.  
  947. (* <expression> ...)
  948.  
  949. Returns the product of all the arguments
  950.  
  951. (/  <expression-1> <expression-2>)
  952.  
  953. Returns the first argument divided by the second argument
  954.  
  955. (AND <expression-1> <expression-2>)
  956. (OR  <expression-1> <expression-2>)
  957. (XOR <expression-1> <expression-2>)
  958. (NOT <expression>)
  959.  
  960.  
  961. Standard logical functions
  962.  
  963. (IN  <expression> <bit numumer-1> ...)
  964.  
  965. Returns 0 if none of the given bit numbers (starting at 0 for the LSB)
  966. is set in the result of expression, else returns a mask of the bits
  967. that were set.
  968.  
  969.  
  970. SUMMARY OF PARAMETERS
  971.  
  972. (help <string-1> <string-2> ...)
  973.  
  974. This is used to specify the help text for each action.
  975.  
  976. (prompt <string-1> <string-2> ...)
  977.  
  978. This is used to provide the "title" of the screen which explains to the
  979. user what this step does.
  980.  
  981. (safe)
  982.  
  983.     This tells the installer that an action not normally performed in Pretend
  984. mode should be performed.
  985.  
  986. (choices <string-1> <string-2> ...)
  987.  
  988. Used to display a series of checkmarks. This is used in the "askchoice"
  989. function to indicate what choices the user has. It can also be used in the
  990. "copyfiles" statement to specify that only certain files can be copied.
  991. (If not present, some other criterion will be used to determine which files
  992. to copy).
  993.  
  994. (pattern <string>)
  995.  
  996.     Used in the "copyfiles" statement to specify a wildcard pattern.
  997.  
  998. (all)
  999.  
  1000.     In the "copyfiles" statement, specifies that all files are to be copied.
  1001.  
  1002. (source <filename>)
  1003.  
  1004.     Specifies the file or directory to be read as part of this command.
  1005.  
  1006. (dest <filename>)
  1007.  
  1008.     Specifies the file or directory to be modified as part of the command.
  1009.  
  1010. (newname <name>)
  1011.  
  1012.     Used in "copyfiles" to specify that a file will have a new name after being
  1013. copied. Used in "askdisk" in assign the new name to the inserted disk.
  1014.  
  1015. (confirm <user-level>)
  1016.  
  1017.     On some statements, the user will only be informed of the action (and
  1018. allowed to cancel it) if the "confirm" option is specified. The user level can
  1019. be "expert" or "average" ("expert" is the default).
  1020.  
  1021. (infos)
  1022.  
  1023.     Indicates to the "copyfiles" statement that accompanying ".info" files are
  1024. to be copied as well.
  1025.  
  1026. (fonts)
  1027.  
  1028.     Indicates to the "copyfiles" statement that accompanying ".font" files are
  1029. to be copied as well.
  1030.  
  1031. (optional)
  1032.  
  1033.     Indicates to the "copyfiles" and "copylib" statement that it is not a fatal
  1034. error to have a copy fail.
  1035.  
  1036. (settooltype <tooltype> <value>)
  1037.  
  1038.     Used to modify a tooltype to a certain value. If the tooltype
  1039. does not exist it will be created; if the <values> parameter is omitted,
  1040. the tooltype will be deleted.
  1041.  
  1042. (setdefaulttool <value>)
  1043.  
  1044.     Used to modify a the default tool of an icon.
  1045.  
  1046. (setstack <value>)
  1047.  
  1048.     Used to modify a the stack size included in an icon.
  1049.  
  1050. (noposition)
  1051.  
  1052.     Used to modify a positioning of an icon to NO_ICON_POSITION.
  1053.  
  1054. (disk)
  1055.  
  1056.     When used with the "rename" statement, specifies that a disk relabel
  1057. operation is really desired. When used with the "askdir" statement, specifies
  1058. that a drive list should be shown initially (instead of a file list).
  1059.  
  1060. (append <string>)
  1061.  
  1062.     Within a "textfile" statement, will append the string to the textfile.
  1063.  
  1064. (include <filename>)
  1065.  
  1066.     Within a "textfile" statement, will append the listed file to the textfile.
  1067.  
  1068. (default <value>)
  1069.  
  1070.     specifies the default value of an askchoice, askstring, or asknumber action.
  1071.  
  1072. (range <min> <max>)
  1073.  
  1074.     specifies the range of allowable numbers for an asknum statement.
  1075.  
  1076. (command <text> ...)
  1077.  
  1078.     specifies the text of a command to be inserted into the S:User-Startup
  1079. file. (Argument strings are merged.)
  1080.  
  1081.  
  1082. PRE-DEFINED VARIABLES
  1083.  
  1084. @icon
  1085.  
  1086.     The pathname of the icon used to start the installer.
  1087.  
  1088. @default-dest
  1089.  
  1090.     The installer's suggested location for installing an application. If
  1091. you installed the application somewhere else (as the result of asking the
  1092. user) then you should modify this value -- this will allow the "final"
  1093. statement to work properly. Note that creating a drawer and putting the
  1094. application in that drawer is considered installing the application somewhere
  1095. else. Set it to "" if there really is no definite place that the "application"
  1096. was installed. The log file will be copied to the drawer indicated by
  1097. @default-dest unless it was set to "".
  1098.  
  1099. @pretend
  1100.  
  1101.     The state of the pretend flag (1 if pretend mode).
  1102.  
  1103. @user-level
  1104.  
  1105.     The user-level the script is being run at: 0 for novice, 1 for average,
  1106.     2 for expert.
  1107.  
  1108. @error-msg
  1109.  
  1110.     The text that would have been printed for a fatal error, but was
  1111. overridden by a trap statement.
  1112.  
  1113. @special-msg
  1114.  
  1115.     If a script wants to supply its own text for any fatal error at
  1116. various points in the script, this variable should be set to that text. The
  1117. original error text will be appended to the special-msg within parenthesis.
  1118. Set this variable to "" to clear the special-msg handling.
  1119.  
  1120. @ioerr
  1121.  
  1122.     The value of the last DOS error. Can be used in conjunction with the
  1123. "trap" statement to learn more about what an error occured.
  1124.  
  1125. @each-name
  1126. @each-type
  1127.  
  1128.     Used in a "foreach" loop (see above).
  1129.  
  1130.  
  1131. @askoptions-help
  1132. @askchoice-help
  1133. @asknumber-help
  1134. @askstring-help
  1135. @askdisk-help
  1136. @askfile-help
  1137. @askdir-help
  1138. @copylib-help
  1139. @copyfiles-help
  1140. @makedir-help
  1141. @startup-help
  1142.  
  1143.     Default help text for various functions. These can be appended to the
  1144. explanation provided for a particular action or used as is.
  1145.  
  1146.  
  1147.         INSTALLER LANGUAGE QUICK REFERENCE
  1148.  
  1149. Overview
  1150.     Attempts to install in "work:" by default if it exists.
  1151.     HELP key brings up context-sensitive help.
  1152.     Esc key brings up the abort requester.
  1153.     Can add assigns to s:User-Startup, and adds lines to
  1154.     s:Startup-Sequence (if necessary?) to make sure s:User-Startup
  1155.     is executed upon boot-up.
  1156.     Can check versions of files/libraries.
  1157.     Install can run in "real" (do it) or "pretend" (dry run) modes.
  1158.  
  1159. Quick language overview
  1160.  
  1161.     Language is lisp-like (lots of parentheses (()) (-:).
  1162.     Variables are typeless (a la ARexx), i.e., strings and numbers
  1163.     are treated interchangably.
  1164.     Strings are delimited with " or '.
  1165.     Certain embedded sequences are available for strings:
  1166.         '\n'    newline        '\r'    return
  1167.         '\t'    tab        '\0'    NUL
  1168.         '\"'    double-quote    '\\'    backslash
  1169.     Statements go in parentheses ( ).  The general format is:
  1170.         (operator <operand1> <operand2> ...)
  1171.     E.g., to assign the value '5' to the variable 'x', use
  1172.         (set x 5)
  1173.     To produce the sum of two numbers, use
  1174.         (+ 5 9)
  1175.     Note that there is no difference between operators and functions--
  1176.     the function 'set' and the arithmetic operator '+' are both
  1177.     used exactly the same way.
  1178.     Combining statements: A statement can be used as the operand to
  1179.     another statement.  E.g.: (set x (+ 3 5))
  1180.     In this case, the statement '(+ 3 5)' is evaluated first, and the
  1181.     result is 8. You can think of this as having the '(+ 3 5)' part
  1182.     being replaced by an 8, leaving: (set v 8)
  1183.     Note that the '(+ 3 5)' part actually produced a value: "8".
  1184.     This is called the "result" of the statement. Many statements
  1185.     return results, even some that might surprise you (such as
  1186.     "set" and "if").
  1187.     Comments are preceeded with a semi-colon ";"
  1188.     Hex numbers are preceeded with a $, e.g., $23 ; 35
  1189.     Binary numbers are preceeded with a %, e.g., %0101 ; 5
  1190.     Many statements return a value, which can be used in
  1191.     assignments, tests, etc.
  1192.     Data can be formatted using a string literal with argument
  1193.     placemarkers, e.g.,
  1194.         ("i am %ld foot %ld inches tall." 6 3)
  1195.         ;produces a string with %ld's replaced with 6 and 3.
  1196.  
  1197.  
  1198. PRE-DEFINED VARIABLES
  1199.  
  1200.     @icon - pathname of install script icon
  1201.     @default-desk - dir. where install wants to put things by default
  1202.     @pretend - state of "pretend" (dry run mode) flag
  1203.     @user-level - 0-Novice,1-Average,2-Expert
  1204.     @error-msg - msg that would be displayed if error not trapped (see trap)
  1205.     @special-msg - custom fatal error message
  1206.     @each-name, @each-type - used in "foreach" loop
  1207.     @execute-dir - If set to a valid path, installer will change directory
  1208.         to it whenever a "run" or "execute" statement is performed.
  1209.  
  1210.  
  1211. DEFAULT HELP STRING VARIABLES
  1212.  
  1213.     @askoptions-help    @askchoice-help        @asknumber-help
  1214.     @askstring-help        @askdisk-help        @askfile-help
  1215.     @askdir-help        @copylib-help        @copyfiles-help
  1216.     @makedir-help        @startup-help
  1217.  
  1218.  
  1219. STATEMENTS
  1220.  
  1221. Many commands have standard parameters (some optional):
  1222.     (all) ; specifies all files are to copied
  1223.     (append <string>) ; add string to text file (for textfile)
  1224.     (choices <string1> <string2> ...) ; radio button options
  1225.     (command <string1> <string2>...) ; add to s:user-startup
  1226.     (confirm <user-level>) ; confirmation
  1227.     (default <value>) ; default value, choice, string, etc.
  1228.     (dest <file>) ; output to <file>
  1229.     (help <string1> <string2> ...) ; define current help info
  1230.     (include <file>) ; insert file in textfile statement
  1231.     (infos) ; copy .info files also
  1232.     (newname <name>) ; specify new file or disk name
  1233.     (noposition) ; make icon "floating"
  1234.     (pattern <string>) ; used w/ "files" for patterns
  1235.     (prompt <string1> <string2> ...) ; text to show user
  1236.     (range <min> <max>) ; numeric input (asknum) range
  1237.     (safe) ; force installer to perform action even if in pretend mode.
  1238.     (settooltype <tooltype> <value>) ; set icon tool type
  1239.     (setdefaulttool <value>) ; set icon's default tool
  1240.     (setstack <value>) ; set icon's stack value
  1241.     (source <file>) ; read from <file>
  1242.  
  1243. Note: Custom parameters are shown below in < >, and standard parameters are
  1244. show as (param..) where "param" is one of help, prompt, safe, etc.
  1245. See above for details on standard parameters.
  1246.  
  1247. (abort <string1> <string2> ...)
  1248.   ; abandon installation
  1249. (complete <num>)
  1250.   ; display percentage through install in titlebar
  1251. (copyfiles (prompt..) (help..) (source..) (dest..) (newname..)
  1252.   (choices..) (all) (pattern..) (files) (infos) (confirm..) (safe))
  1253.   ; copy files (and subdir's by default). files option say NO subdirectories
  1254. (copylib (prompt..) (help..) (source..) (dest..) (newname..) (infos)
  1255.   (confirm) (safe)
  1256.   ; install a library if newer version
  1257. (delete file (help..) (prompt..) (confirm..) (safe))
  1258.   ; delete file
  1259. (execute <arg> (help..) (prompt..) (confirm) (safe))
  1260.   ; execute script file
  1261. (exit)
  1262.   ; end installation
  1263. (foreach <dir> <pattern> <statements>)
  1264.   ;do for entries in directory
  1265. (if expr truestatements falsestatements)
  1266.   ; conditional
  1267. (makeassign <assign> <path> (safe)) ; note: <assign> doesn't need `:'
  1268.   ; create an assignment
  1269. (makedir <name> (prompt..) (help..) (infos) (confirm..) (safe))
  1270.   ; make a directory
  1271. (message <string1> <string2>...)
  1272.   ; display message with Proceed, Abort buttons
  1273. (onerror (<statements>))
  1274.   ; general error trap
  1275. (rename <old> <new> (help..) (prompt..) (confirm..) (safe))
  1276.   ; rename files
  1277. (rexx <arg> (help..) (prompt..) (confirm..) (safe))
  1278.   ; execute ARexx script
  1279. (run <arg> (help..) (prompt..) (confirm..) (safe))
  1280.   ; execute program
  1281. (set <varname> <expression>)
  1282.   ; assign a value to a variable
  1283. (startup (prompt..) (command..))
  1284.   ; add a command to the boot scripts (startup-sequence, user-startup)
  1285. (textfile (prompt..) (help..) (dest..) (append) (include..)
  1286.   (confirm..) (safe))
  1287.   ; create text file from other text files and strings
  1288. (tooltype (prompt..) (help..) (dest..) (settooltype..) (setstack..)
  1289.   (setdefaulttool..) (noposition) (confirm..) (safe))
  1290.   ; modify an icon
  1291. (trap <flags> <statements>)
  1292.   ; trap errors.  flags:1-abort,2-nomem,3-error,4-dos,5-badargs
  1293. (until <expr> <statements>)
  1294.   ; do-until conditional structure (test end of loop)
  1295. (while <expr> <statements>)
  1296.   ; do-while conditional structure (test top of loop)
  1297. (working)
  1298.   ; indicate to user that installer is busy doing things
  1299.  
  1300.  
  1301. FUNCTIONS
  1302.  
  1303. (= <expr1> <expr2>) ; equality test (returns 0 or 1)
  1304. (> <expr1> <expr2>) ; greater than test (returns 0 or 1)
  1305. (>= <expr1> <expr2>) ; greater than or equal test (returns 0 or 1)
  1306. (< <expr1> <expr2>) ; less than test (returns 0 or 1)
  1307. (<= <expr1> <expr2>) ; less than or equal test
  1308. (+ <expr1> <expr2> ...) ; returns sum of expressions
  1309. (- <expr1> <expr2>) ; returns <expr1> minus <expr2>
  1310. (* <expr1> <expr2> ...) ; returns product of expressions
  1311. (/ <expr1> <expr2>) ; returns <expr1> divided by <expr2>
  1312. (AND <expr1> <expr2>) ; returns logical AND of <expr1> and <expr2>
  1313. (OR <expr1> <expr2>) ; returns logical OR of <expr1> and <expr2>
  1314. (XOR <expr1> <expr2>) ; returns logical XOR of <expr1> and <expr2>
  1315. (NOT <expr>) ; returns logical NOT of <expr>
  1316. (IN <expr> <bit-number> <bitnumber>...)    ; returns <expr> AND bits
  1317. (<format string> <arg1> <arg2> ...) ; printf clone
  1318. (askdir (prompt..) (help..) (default..)) ; ask for directory name
  1319. (askfile (prompt..) (help..) (default..)) ; ask for file name
  1320. (askstring (prompt..) (help..) (default..)) ; ask for a string
  1321. (asknumber (prompt..) (help..) (range..) (default..)) ; ask for a number
  1322. (askchoice (prompt..) (choices..) (default..)) ; choose 1 options
  1323. (askoptions (prompt (help..) (choices..) default..)) ; choose n options
  1324. (askbool (prompt..) (help..) (default..) (choices..)) ; 0=no, 1=yes
  1325. (askdisk (prompt..) (help..) (dest..) (newname..))
  1326. (cat <string1> <string2>...) ; returns concatenation of strings
  1327. (exists <filename>) ; 0 if no, 1 if file, 2 if dir
  1328. (earlier <file1> <file2>) ; true if file1 earlier than file2
  1329. (fileonly <path>) ; return file part of path (see pathonly)
  1330. (getassign <name> <opts>) ; return value of logical name (no `:')
  1331.   ; <opts: 'v'-volumes, 'a'-logical, 'd'-devices
  1332. (getdiskspace <path>) ; return available space
  1333. (getenv <name>) ; return value of environment variable
  1334. (getsize <file>) ; return size
  1335. (getsum <file>) ; return checksum of file for comparison purposes
  1336. (getversion) ; return version/revision of file, library, etc. as 32 bit num
  1337. (pathonly <path>) ; return dir part of path (see fileonly)
  1338. (select <n> <item1> <item2> ...) ; return n'th item
  1339. (transcript <string1> <string2>) ; puts concatenated strings in log file.
  1340. (tackon <path> <file>) ; return properly concatenated file to path
  1341.